Code Complaint with all python versions

changed xrange to range to make code complaint with all python versions