Fixed the script (due to stupid typo) and added nice printing functions