added main and improved header