Added sorting functionality. Sample modal dialog