refactored cursor class and added license headers