Crash fix, Queue changes

Slightly improved Queue class, added step-by-step comments.  Changed
Grid class to work with Queue changes. Fixed Fill function crashing, was
handling the edges of the grid wrong.