added base encoder