Dialogue + code cleaning

Dialogue now goes all the way from the start to end.
More stuffs turned into function to make it easier to read and fix.