Function Updated

Updated function to modern syntax