TODO: Comment the code too.  I get the feeling that you're changing layout based on page size but not much else.