Added comments and fixed display bug