Improve resizing and add zindexing