1. Added docstrings with Google style.
2. Reformat file with PEP8 and Google style guidelines.