done rewriting sorting chapter