rebuilt with functional code