more-or less working - constraint need modification!