Completed But Untested Version Of Function