some mathematics done

correct hex after click detected ( should be tested)