Finish first try at functions