Fixed how Main calculates

It was all bugged