added a header and cleaned up some unused code