Completed matrix B and minor adjustments

Completed matrix B
Added constraints on inputs and made sure that the numeric keyboard
opens for input.