code cleanup & updated jquery version