changed to use getopts

Changed to use getopts
fixed some messages
added flag to exit when an orphan lock is found