add dump routine for debugging