Finish comments and fix bug