started implementation of contraints functions