cleaned up some NPEs. added build script.