Added constraints and a sub goal for problem 3

Added constraints and a sub goal for problem 3