updated a bit of the main method