fixed shuffle-function