put the simplex case into a separate function ot be used for both ascend and descend tasks
bug fixing