Added support for weights