Implemented Dialog Library and fixed bugs.