Modified bezier.py for smoothness