working state, but too much logging and debug printing
cleanded up code and removed debug prints