division. fixed arrayIndexOutOfBounds and implemented a test