some improvements everywhere
moved fill procedures to another file