iPython code from PhD research