Fixes + main code