Adding the function to repo. Incomplete