bug fixing. first final version