Cleaned up code (flip a coin query)