update the script and style to handle multiple attributes