Added the remain logic of the application