refactored stl stuff from pixel printer