added getSize() method
changed to more reliable orientation detection