Modularized analysis code
Moved