Adding outputResult method