moving js to separate file to deal with later