Updated extension.cpp