Create main

actually this one is run as a service