free changed to delete/delete[]