add the bottom analysis code