print format bug corrected;ability to run as script