this is simpler and works the same