Fixed numpy random issue, added function arguments to a couple of things, found "index out or range" cause and marked it.