Added cursor class, fully implemented it