custom widget rearranging code