Committing CPU simulation code. Not yet complete and have to understand