Added trap for Ctrl+C, and code for the function to ram_lib