fix compilation error and remove defunct code.
take 2