sped up, fixed bug regarding random