added public helper method for applying weights