Improved code a bit, without the help of ABI. No help was requested.