changed Nod to class instead of struct