mid-way commit
refactored main.js / added leave functionality