modified to match previous version