Corrected Code

Simplified & Corrected Code.