Add length func to gauss.sage