added all the object management functions and other minor things.