fixed all memory leaks, Valgrind comes back clean. Also uploaded ll without main function