Edited main method