This function needs a return  This seems to work properly. 