reformatted, removed dependence on res.cls