Refactor to fix several lines of logic

Needed to simplify several lines of logic to avoid potential problems.  Also added a commented out test line for testing the test method.