hard work on main script, some prints and comments