public void renderPlanes(int x, int wallY1, int wallY2){

        Screen screen = raycaster.getBuffer();
        Camera camera = raycaster.getCamera();
        Map map = raycaster.getMap();

        double sin = math.sin(camera.getAngle());
        double cos = math.cos(camera.getAngle());

        double screenWidth = screen.getWidth();
        double xPos = ((((double)x)/screenWidth) - 0.5) * 2;
        double xGrad = xPos / camera.getProjectionDistance();

        if(camera.getY() < map.getCeilingHeight() && map.hasCeiling()){
            int boundary = wallY1;
            if(boundary > this.ceilingboundary){
                boundary = this.ceilingboundary;
            }
            renderPlane(screen, camera, map, 0, boundary, x, xGrad, sin, cos, true);
        }
        if(camera.getY() > 0){
            int boundary = wallY2;
            if(boundary < this.floorboundary){
                boundary = this.floorboundary;
            }
            renderPlane(screen, camera, map, boundary, screen.getHeight(), x, xGrad, sin, cos, false);
        }

    }