Cleaned code & removed warnings