append using foldRight