fixed bug with upper limit calc