main and usage implementation