Added the logic