Working cycles, solved js issues