better var initialization; checking correctness of nn