restructured and reworked to support ninja example