Added tests and format fix v2