Issue with marching cubes, anyone willing to have a peek at this?

As I understood from what I’ve been reading, yes. I could be off in my understanding though, to be honest. Trying to understand how to create voxel terrain has been a heck of a ride for me.

This is where I initially was reading from: https://courses.cs.ut.ee/student_projects/download/138.pdf

Do you have any suggestions on how to better calculate/use density? Am I just not understanding it properly?