Fix logic when starting from numbers other than 1