Attempt to implement Assignment 2 cs193p Stanford in Swift