Updated & Made the code cleaner.