updated main and code structure for beutification