Write test and correct mistakes