I think you need to print spaces too. so that your first asterisk would be placed at the center