Improved documentation and performed minor tweaks.
General documentation has been improved, and where documentation did not previously exist, comments have been added. Also optimized Routines' calculateLogic() return value, which should aid in quick responses.