cleaned up programs, added cleanup routine