added square shape option and changed behaviour