Changes made as suggested by lucperkins