Moved to a more step-by-step approach.  Also optimizations and fewer magic numbers.