fix error and change takeFromTo to takeNFrom