shell interaction now loops and much refactoring