Latest updates and tweaks from suggestion at StackOverflow