Merge John's fork into alim4

Merge John's fork into alim4