move exception to constructor, change 2d arr to 1d in perc