Changed pin assignments, replaced register assignments with defined functions.