added sample config file and fixed a ton of bugs