gd functions added