add g flag to sort so that it will perform numeric comparison