fixed bug in extract select; reduced number of constraints for simplicity