solved some of the problems associated with copying and added few functions to be used later