removed unneeded check. Array.slice does all the needed checks