added comments for stats and main