improved main
fixed print
automated tests