fix a silly calculus bug and comment a lot of console.logging