added constraints code to tutorial