Fixed all program errors. Still leaking though