using new wrapper for search
fixed bug with energy calc