Velocity encode decode added. Rest is all attempts at debugging