encoding part added