intersection code fleshed out. not tested