variables `x` and `y` shadowed the parameters, and `containerX`, `containerY`, `containerWidth` and `containerHeight` were used without being initialized. they could be replaced by the parameters `width` and `height`
minor fixes