<3 inline if

added getCharVal function and changed some if into an inline if b/c muh shortness