Adding profiles script and some corrections