removed the malloc since the array size is known at compile time and added a exit to the integer check