fixed analysis to use cosmos library properly