added some more code to help reduce startup cost to interesting solutions