better weights function
html "interface", using real dict in tests