Merged Code, fixed bugs, better printing, better randomness