Modified existing code to work with Notifications