works but with bugs
works fine when height is larger