now with functions!