added questions and fixed file io