first implementation of build