merge manu's modifications about negative multipler and some other small things