Fixed Typo, Improved encoding layer, Tidied.