Cleaned up code (renamed constants, reordered functions).