code is debugged and tested on the softcore!