Moved fill sequence to function