fixed memory leaks
added relevant function for test
added test for _removecycles() and _makescaffold()