May have finally fixed memory problems #21