[IMP]Improved some code.