Complete function, now with example usage