Made fill function slightly more efficient