moved most of the original js into a future project