added implementation of registration and log in