basic code outline in place, untested with circuit