some fixes and created main method