changes made to several constraint calculations, logic errors mostly