tried this uprod crap from stack overflow