implement format2
debug
implement and merge the functions from Andrea