working on first register function