Nearly finished assignment 2