added simple logic