fixed some bugs... but it is not the end...