changed && recommented maskCalculateHost bits to use case states and be more descriptive
fixed fucntion calls