Reformatted code  and added jquery dependency.