some big changes, connection added to extra file, debuging code outputs commented ...