improved analysis scripts