continued changes to register

continued changes to the registration function, still not working as
intenden.