getting code up to npm standards