replaced the junk sq.pas with an abstract sequence type that provides a cursor