Changed sas to function