hopefully fixed sorting problems