code to read degree 2 curves added
fixed a bug in curve reader
fixed some bugs in curve tree key creation and accessing indices.