added pal1 and test fcn