Added locals and tests