Updated to not rely on a fancy shell constructs