fixed bugs
Code cleaning v1.0