making sure the process doesn't stop when it is not finished. we need to use promises to fix this code
fixing sorting and also providng colors