added type() method