retab python file and give it all features of c version