Updated to shorter code, and fixed notification count