[IMP]: Improved the code