Added hand checking logic.