Implemented nscopying
added subclass check
Removed dead code and cache
fixed null where