Fixed #25

Minor refactoring & corrected variable names