changed syntax from getLength() to count(), added parent()