Tidy the code and update the credit