Replaced fixed sizes with sizeof() to remove human error