Added keyboard interrupt handling (sort of...)