included better logging of weights and changed over the retrieval