Completed Analysis Code