initial version which somehow works from the commandline