Changed sample to getSample to not override sample function