I think the code is pretty much working, except that the alignment seems to mess up sometimes
going to bed