Implemented Sort Method