Hand gesture function splitted into 2 parts.