Imperfect, but working for these constaints