material check, modification of UI

Re-written all the material check, some little modification of the UI
Little optimisation of code