fix header
use combined functions for encoding and added a benchmark function
add x argument for benchmarking