improved elements script