some codechanges and additions.