* Are you aware that you are only using your static variables height
and state in your main method? I'd suggest to have those variables
be local variables in your main method then.
* Add more comments to your code to make it easier to read what, for example,
the goals of your for-loops are. I (and you after X months) have to completely
figure it out myself. Something like:
* After you've done that, you'll quickly find out that
you should not have put your
for-loop for variable k (denoted A above) within your for-loop of variable j (denoted B above).
Good luck finishing up