added a coinflip function