refs #1486 code cleanup, implemented some comparisons, bugfixes