Silly indexes error before! everything is working properly right now. Next step: clean up the code!