fixed bug in functionNaming, changed formatting of errors