Forked Assignment2 from Assignment1 for better comprehension