Final function verions post testing and commets
Final function versions post comments, testing, and file clean up