added ntake
added ntake plus tests
corrected implementation of ntake