reformatted code, added sample project