Revert "Changed range() function according to python 3.x and corrected some errors"

This reverts commit 5239941a2130ab59499d26a199bd54e6239d1905.