moved constants to a header file; minor format and readability changes

removed unneeded inlines
changed unit values to constants (no multiplying kilo)