Quick sorting in python