update from ralphc's changes