added the basic program but needs to rework it into pure javascript (now it's a processing program)