rankall portion for programming assignment 3