Restored subject controller and model changes

Reverted back to using a sorting function