New features

added registration option, more optimization and fixes