Added error messages for mathBox eval
Reordered some calls to fix order issue and restructured some sections to make them more readable and resilient