creating functions class exercise