Added an alternative implementation that utilizes compilation-mode