Fixed snippet issue. Cleaned code.