added registration function, added examples to other functions