Modified robot analyze to use references, subtract out template