fix the contraints on the two functions