updates main method