Changed forgotten magic numbers to constants and parameter.
Fixed string comparison with == which could work but probably will not.