almost finished the hint logic