This is my solution to assignment 2 of CS106A