One thing to note. Always try to make your code as clean as possible. Like followingthe basic code structure that applies to all forms of coding. Anyways, my english has really improved
.
Also, Try to make your code as efficiant as possible. this can be measures when you look at the e2 itself and check the ops. (operations per second). this makes the server less laggy and not do as much work. I would have to point somthing out. How come you used interval of 0.5? like interval(20) is more then enough.