Added input handling and subscribing