finding weights
hi my name is dorothy and I can't index into things properly. oops.
adding optimization
Merge pull request #2 from dschen/dorothy

optimization, I think