changed setup.py and finalized divide and conquer. added energy constraint