Possible Duplicate: How does this work? Weird Towers of ... Might be easier to see in PSEUDOCODE:
stackoverflow.com