Boundary conditions check needs to be added. There are hardcoded maximums being used without any boundary conditions.