First attempt at #317.