started working on register function