Did some debugging
Wrote some small Javascript functions