Removed string module dependency for Python 3 compatibility.