Algorithim practice in javascript (Orrrr I could have used drunken-octo-hipster as a name. Do they sell pbr under the sea?)