use flags to read in command line args. thx to @Profpatsch