Added logging
Added buffer limites to ensure we dont get overruns on an attack; added logging