registration function works (kinda)