added option to specify reference weight