Fleshed out basic structure and added detector code.