Finished writing login and register mechanisms