Added typecasting of updateModel
Fixed bug in breaking references
Refactored arrayDiff function
Fixed syntax errors
Added custom typecast support