saving small modification for improved output-still need more work