fmt'd the code to make it pretty