put some printing functionality into functions and added a nice table formatting for the output