little code cleanup and fixed vertical win issue