added code for attiny and organised into classes