bug fixing and changing of prints to new printf() format - BROKEN