Fixed/implemented subscribe logic

Rewrote the entire subscribe/unsubscribe logic
update