fixed memory violation errors. test is running now