update usage text and clean up code a bit