Reorganized code, copied from windows side, added ADC noise sampling, 'fixed' PORTB bug, added proper seeding.