Modified to actually fill in the output