adding styles and better logic