add comments
remove unnecessary functions