function finalized, sess() function implemented
merged