Added colour codes and log function