main method initialise
updated with main functions