Cleaned code a bit, removed and commented out unused codes