updated so that plc.py can be used also nicely from the command line