tweaked tests for better coverage
added comments and var cleanup