The program works but there are memory leak issues and much room for improvement