Added support for circuits with 4 and 8 neighbor connections.