corrected syntax error with result output