(half commit) second parsing algorithm version, sub-circuits not working as expected