finished writing apply_constraint, now I just need to do testing