Cleaned up Program 1