Added action lists and rewrote javascript