cleanup
array slice was being used incorrectly. The second parameter is the number of elements needed not the ending index