Working on q1 for A2. Added some functions.