Basic decoder. Does not adapt yet.