Added an example folder to test the program.
Fixed iteration.
Fixed memory leaks.
Bug and memory fixes.