Code written during PIC10A discussions