prototype1 with delete and sort working