Bug fixes and put circlehandler in a "class"