Adding some more logic