improved solving functions