Continued reworking algorithms... some fixes the the MIME type