Added delete for pointers, reorder includes, replaced string with wstring, and used auto for iterator.