adding code to visualize weights