Slightly refactored. Finally fixed names