Insert method implementation. Main class added