fix indenting

add main function
use "with" to open file