math logic added

completed logic for project controller