Fixed QuickSand Implementation