added encoder_functions.h