formatted main and tests