Revised js structure, started working on UI