Corrected usage of prependTo and appendTo.