started work on task 4 checking for array types and checking number indexes given against length of array