pep8 fix
check for proper pin number
added function to read the pin state
history file not needed