Some really sketchy bit manipulation.

TERRIFYINGLY SKETCHY