Added general fill function.