Fixes the invalid moves problem and works on getting the hueristic function working well.