revised to simplify interface