Why don't you try this approach to printing the hollow square? If it is the first line - then print a star else if it is the last line - then print a star else if it is the first row - then print a star else if it is the last row - then print a star else print a space When you get this to work, see if you can optimize it. Thanks, -- Mikhail