The only thing I'm not quite understanding now is that the k for-loop uses the condition k < 2, should this be k < 3?
Yes it should. I fixed my first reply.
Ah okay cool thanks, I'll give this another go because this makes sense to me now :)
Thanks for all the help and really quick responses!