further fixes to the code, window resize behaviour not 100% sorted