added convert and revert, added logging