added niceScale function