Updated the code so it should be a little eaiser to read. Split it into
functions. Also implemented the config file.