Initialize $result counter