added directional functions to views, modified templates, also updated motorfunctions.js