wow, i feel pretty dumb. the max argument means up to but not including. which means random(2) outputs 0 and 1.

Problem Solved