minor changes
created malloc for larger N