more efficient top implementation.