Some minor improvements, cleaning, added functionalities. Version fully runnable.