created register function and reworked views/controllers