huge refactor to deal more with layer instead, this corrects the draw order