added imgs, cleaned up code