moved cloud sorting to print function