commented main code