added_function
Added the coinflip function, and did some minor changes to some code.