syntax and logic errors repaired, enchanced view