Finished main-function and inserted lots of print

statements for debugging.