For assignment 3 in AI