lookup tables instead of function calls, way faster (on my netbook at least)