clean up file save + formatting, remove debug prints