finished register function

well mails and so on is still missing