document ready wrap

wrapped it all in a document ready function.