save the chain
newline
check for nan