reformatted gmail.py to potentiall work on server