Modified Will's helper funtions to allow for optional parameters