added fadeIn functionality, and cleaned up the code.