pop up preview still need to write to window
preview pop up working
Add min button