Flattened some nested if statements
Fixed mouse drag bug (issue #4)