Adding two answers from Stack Overflow