changed redundant code, used class selector insted of iterating using each, add events just binds using callbacks