Add improvements suggested by domob1812