returned to functional version for testing