Correct bug from leftover logic from previous implementation
Taken out comments to trace modifications