fixed equation printing functions
sort routine improvements
completed developement of mgaquery