added advanced functionality to the build() method