New python gist; negative weights in functions; javascript negative functions