Cleaned up code, added commented deep copys