method to get finger mask based on finger position
Yes, this can be done simply by using a power of 2.  

private int getFingerMask(int fingerPosition)
{
    if (fingerPosition &gt;= 0 &amp;&amp; fingerPosition &lt; 10)
    {
        return (int)Math.Pow(2, fingerPosition);
    }
    else
    {
        return 0;
    }
}