Thanks for the replies, I have read the datasheet, (http://www.wvshare.com/datasheet/NXP_PDF/74HC165.PDF) this was my interpretation of where I thought the pins should be in the comments at the top.
I'll take it apart and put it back together and try out your code too.
Thanks
Neal