Optimized it and added the modal