Smart app for two ways sort