Registering of signal; Should work roughly but there still is room for improvement; Code needs to be cleaned up