changed order of some elements. Moved js into separate file