A bug fixed and level end logic almost complete