added entities and decode method.