Add comments and fix append/select