[UPDATE] Add median special case to lib, test