added functions
Big changes