Created safe_malloc() function which checks for failure, and if so performs necessary cleanup. Began working on making only a limited number of messages appear in window.