fixed bug with tests + returned old weight