Added signal handling and a couple of options