minor fixes

minor fixes made. deprecated code deleted, can be found in old versions of the script