integrated code so far