Cut and paste from CodingBat