Renamed shiftLeft to collapse. Changed collapse implementation to use fold vs recursion. Added array slicing functions.