Stanford university CS107 assignment 2