Add comments, remove unused code