Code for Task 2 of AppDev