Added basic regitster logic.