Hi can you rewrite the following for me keeping all original functionality in pl