fixed compare function and messed with constructors