getting preprocessing ready for encoder