fixing code, adding graphics .... and some refactoring