Javascript port of my final coursera python project (RiceRocks)