Adding a BASH function that actually works