works as specified, not if range starts at 0