improvements suggested by Alex