dialog boxes; new layout of map buttons; big code refactoring