Implemented chop function (array) and tests