Rearranging programs to top