temp solution ported from elsewhere