Removed deprecated md5, replaced with hashlib
Code formatting