better arg parsing, error handling and commenting