Fully remaked main.d