tried improving performance by setting 3 variables to a commonly used multiply function, reducing the large amount of multiplication used for these variables down to 3