replaced with better argument parser
complete functionality of -l helper function