function source code can be updated

needs some clean up