Finished ,added constraints