Adding a function that gets reads weights