fix and format test and code