Added logic helper to clarify some boolean expressions
merging in changes