Analysis script stolen from Rinde