Adding functions defintions