added limit() and fixed range()