Added constraints file and full function implementation