add main, and usage for testing