Add more comments, code prettify