Simple Camera Manipulation (Math)

final float dx = Mouse.getDX() * 0.1f, dy = Mouse.getDY() * 0.005f * 0, sdy = Mouse.getDWheel() * 0.1f;
				offset += sdy;
				pitch += dy;
				y += dx;
				
				double vert = offset * Math.sin(pitch),
						horiz = offset * Math.cos(pitch);
				
				double offsetx = offset * Math.sin(Math.toRadians(y)),
						offsety = offset * Math.cos(Math.toRadians(y)),
						p = 180 - y;
				
				this.getPosition().x = (float) (element.getPosition().x - offsetx);
				this.getPosition().y = (float) (element.getPosition().y + vert);
				this.getPosition().z = (float) (element.getPosition().z - offsety);

While this code works, I need to rotate the camera towards the center focus. The camera currently spins around the center object (called element, this being the camera). I disabled the y transformation currently by multiplying by 0.

As per “p = 180 - y;”, my understanding is that this fixes the rotation, but it causes my camera to always face somewhere not looking at my element. Thusly, “p = y;” doesn’t follow the camera, but brings it into the center of the view.

Could anyone help shine light on this subject?
<3