Make the main function smaller
Switch to using the ed format