as.Trial function added and implemented