Migrated code from https://newerahpc.googlecode.com/