The code samples from aerotwist