started working on buff decoder