fix whitespaces and add property for result.principal