optimize details and bug fixing
automatically scale accroding to the window size