Implementing fill function for objects.