[IMP] Improved the code.