lmk: update code from mako. thanks @mrg666