compilation function