new method, much simpler and more effective