Cleaned up code and added close button.