revised to simplify