Fixed memory leak
Fixed memory leak
updated comments
Formatting