mateon1's script with less excess stuff