add twist function

add twist, fix bugs
pyc file