finished the hard constraint function. Currently putting in try-catches.