changed back function from being type method