implement DOM functions