add in some event code, resizes are a little odd