3.0.0 - rewrite for use with dat listen hook