Added constant variables, removed comments, and fixed some memory leaks