minor improvements
using ("property" in element) now instead of (element.property)