refactored ruby and did js - both functioning but need interface tweaks.