Added fade feature, and cleaned code