cleaned up some of the jquery code