added new function as.fdsample