added format function