Add more comments and debug