cleaned up mains, completed main 4