Changed some stuff but credit goes to lquifi