r19761: This may need work, but here is an initial implementation of