added a couple more features from Ng&Cardie