fixed a couple typos/logical errors; "devide"-> "device" in a function n...

...ame, "input"-> "output" in open()