changed images and improved the logic