revised restart functionality and option parsing