fixed another sample function