commented code. made resizable