Added ifdefs for switching between 32 and 16 bit