added constructor for leaf and node