fixed bug in weight update, had to use cycles from itertools as there is no way to map across two lists easily in python, seems to work great