Remove comments. Move main logic to the top.