Main method provides more functionality, fixed a couple bugs