passed cp1 Test1 & Test2 but codes needed to be refactored