fixed bad math, added flash power

Added flash power input, fixed my silly math, refactored formulas for
cleanliness