changed eval code block function to method of sw block from global method