fixed a couple typos/logical errors; "devide"-> "device" in a function name, "input"-> "output" in open()