trying to implement functions