Changed pin numbers so that they are indexed from 0-7 rather than 1-8