removed ; at the end of every statement

also changed all 'if x =~ nil' with 'if x'