added strategy design pattern for sorting the entities