started reworking main loop, removed includes from validate.sml.