fixed limit from 0 to limit-1