fixed some import errors, implemented demodulation