make some functions inline
Add in rank weighting