added functions
fixed merge conflicts