Both solutions are very good though I prefer the simplicity of Egg's script.