updated to hopefully express all constraints. still confirming correctness