fixed some warnings, moves some if elses to switch statements
fixed warnings, changed some if else to switch