Added more logic;