minor sorting
add shuffle func