I don't know when I'll work on this script again so this is an update I made while ago but didn't publish 'cause it's not complete.