Implemented getArrayType
Variables are now initialised to sensible values
Arrays are now checked for length before copying