implemented void main(), and int getN()