checking in merged changes from internal including sort adaptor and bug fix for 90 degree orientation