Python Sort List Using Function For Adding