making fit constraints a bit more general