finished optimization based on dsm.