added some functionality's for the exercise till step 4