native impl
reworked calling main method