fixes issue #40
refactored node spec and added tests