replaced stem functions with real functions