Please post the errors you get when you run the codes. Btw, your use of o for 0 wouldn't work as a position holder in an array.