functionality for accessing weights