Updated Code at end of sprint 2