devcode backup

fixed a new selection error; started GUI refactoring