Reworked the automount script