Removed a few comments and switched the file read to a function.
Removed some old comments.
Took care of error when no file is loaded in the open file dialog.