some alterations to the advanced options menu

make sure the scrolly buttons don't overlap the window border.

don't make any changes to the options unless you hit "ok", so that the
cancel button actually serves it's purpose.

optimize and refactor things a bit for future-proofing.