Moved code around to make cleaner and fixed image.