Working on rank count
Think it works, now for documentation and review
Documentation and bug fixes