all method finished
implements the main method