Credits @drtshock
Modifyed to my use