updated for missing use strict, various code cleanup