added offset option and tests for it and limit