added registration functionality, modified a few other files to support this