cleaned up img & wrote stuff