added bash version of solution