moved main to head