Added material score, bug fixes