refactored and continued to add ailogic - blocking