(seems to work), a bit quicker
(seems to work), hrank calc updated