Commented and refactored run.sml