Implemented the suggestion from @monofone