changed math (but does the same thing) and removed legacy note