fix PEP8 violation
A simple conditional write method implemented
Implemented basic imports