Added many new functions, mainly a good gui structure