documented and reviewed existing functions