New coin flip code