Made template funtioning