Implementation of all 3 goals for chess interview problem