Made minor revision to loop iteration logic and control structure. Added some comments
Added comments/explanation to the logic behind the bytesToSample and the sampleToBytes methods