Added python functions and some other small founctions