added hand logic