Changed multiplications to bit shifts where possible. Updated to use <<= operator