Formatting and Optimization

Fixed up formatting and "recombines" elements after search.  Debug info
added.