Fixed typos and scope issue and reversed the sort order