beginning of prototype impl