made changes to the algorithm to make sure the percent stays the same and is only taken once. Should speed up code and improve scaling of images and objects.