added proper functions
added functions and removed branch fix