Working version of AI with heuristic function based on amount of empty tiles