add a few more comments and functions