Hackign away at javascript to get the ui to work