Modified according  to assignment requirement