Hmmm. I created a test function using arrays instead of a database, and I get a normal distribution instead of the biased one.

My head hurts.