Replaced stubs with real code