...but this results in a lot of memory usage ( 7k )...
Flash or SRAM? Which are we trying to optimize?