Added code according to the assignment
Added code according to the assignment