Hepler function to evaluate code