Documented code.
VERY IMPORTANT, A FIFO BUFFERE WILL HAVE TO BE USED