Fixed the passes problem
Scrubbed code
Fixed null errors, boundary conditions