Completed function R&R exercises