fixing bugs and adding CTR-C