cleaned up code, fixed error with sizeof array