Add test and format code.