Added sorting elements per row

Signed-off-by: loku <daniel>