final code with report explaining encoder error preventing completion of assignment