got rid of precalculation
tweaking & code cleanup
code cleanup