This is the worst js I've ever written, but oh well. Added alignment visualization. Made some layout changes.